package com.gardeneaters.game_v0.autoplay;

import java.util.Vector;

import com.gardeneaters.game_v0.playingfield.Hexagon;
import com.gardeneaters.game_v0.rules.Hexagons;
import com.google.gwt.user.client.Random;

class Bot extends BotHelper{

	private int team;
	//private int[] noTeamHexUnderAttack, enemyHexUnderAttack;
	
	
	protected Bot(Hexagon [][] _hexagons, int _team) {
		super(_hexagons, _team);
		this.team = _team;
	}

	protected void play() {
		super.update();
		
		for(int k=0; k<enemyHexPos.size(); k++)
		{
			Vector<int[]> noTeam = noTeamHexPos.elementAt(k);
			Vector<int[]> enemyHex = enemyHexPos.elementAt(k);
			
			//Random.nextInt(noTeam.size()-1);
			
			//if(enemyHex.firstElement()!=null)
			
			int random;
			//System.out.println("enemy size "+enemyHex.size()+" random "+random);
			int[] tempPos;
			if(enemyHex.size()>0)
			{
			//	random = Random.nextInt(enemyHex.size());
				tempPos = enemyHex.elementAt(0);
				pointAtMe(tempPos, 5);
			}
			if(noTeam.size()>0)
			{
				//random = Random.nextInt(noTeam.size());
				tempPos = noTeam.elementAt(0);
				pointAtMe(tempPos, 5);
			}
			
			
			
		}
		//int[] pos = super.getCenter(team);
		//if(pos==null)
		//	return;
		
		//pos = super.getNearestEnemyTeamHex(pos[0], pos[1]);
		//super.startPointingAtMe(pos[0], pos[1], team);
		
		
//		hexagons[pos[0]][pos[1]].setTeam(2, true);
//		hexagons[pos[0]][pos[1]].setPointingTo(2);
		
		
	}


	


}
